<!doctype html>
<html>
<head>
<meta charset="UTF-8" />
<title>社区拼团、店铺分拣，开心享受家乡美味</title>  
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width,initial-scale=1.0,maximum-scale=1.0,user-scalable=0" />
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<meta name="format-detection" content="telephone=no">
<link rel="stylesheet" type="text/css" href="__PUBLIC__/Wx/css/base.css" />
<link rel="stylesheet" type="text/css" href="__PUBLIC__/Wx/css/index.css" />
</head>
<body>
<div class="group" style="padding-bottom:0;">
<form action="__MODULE__/List/search/" method="get" enctype="multipart/form-data">
    <div id="header">
    	<div class="logo"></div>
        <div class="search"><input name="keyword" type="text" placeholder="搜索特产"/><i></i></div>
    </div>
</form>    
    <div class="sort">
    <volist name="all_c" id="vo">    
    	<span style="<if condition="$type_id eq $vo['id']">color:#f9790b;</if>" onClick="window.location.href='__MODULE__/List/Index/type_id/{$vo.id}/'">{$vo.title}</span>
    </volist>
        <div class="clear"></div>
    </div>
    <div class="collage">
        <div class="community">
        	<div class="tab"><span class="on">全部</span><gt name="user.c_id" value="0"><span>即将成团</span></gt><span>最新开团</span><span>即将开团</span></div>
            <div id="tab-content">
            	<div class="block">
                	<ul id="list">
            <volist name="shoparr" id="vo">
              <li> <a href="__MODULE__/Prodetail/index/id/{$vo.id}/">
                <div class="pic" style="background-size: auto 170px;height:170px;overflow: hidden;background-image:url({$vo.f_img});background-repeat: no-repeat;background-position:center center;"><!--<img src=""/>--></div>
                <div class="intro">
                  <h2>
                    <eq name="vo.type" value="0"><b class="xc">乡村</b>
                      <else/>
                      <b class="md">门店</b></eq>
                    {$vo.title} {$vo.u_num}{$vo.unit}</h2>
                  <h3><em>￥<b>{$vo.actual_price}</b></em>
                    <gt name="vo.neednum" value="0"><i>还差<b>{$vo.neednum}</b>份成团</i></gt>
                  </h3>
                  <p><b><img src="{$vo.f_avatar}"/></b><i>{$vo.f_realname}</i><em>已售{$vo['actual_num']+$vo['v_num']}份</em></p>
                </div>
                </a> </li>
            </volist>
                        <!--<div class="clear"></div>-->
                    </ul>
                    <!--<div class="more">向下滑动<img src="__PUBLIC__/Wx/img/more.png"/>加载更多</div>-->
                </div>
        <!--下面是即将成团-->
        <gt name="user.c_id" value="0">
          <div class="block" style="display:none;">
            <ul>
<volist name="needgoodarr" id="vo">            
              <li> <a href="__MODULE__/Prodetail/index/id/{$vo.id}/">
                <div class="pic" style="background-size: auto 170px;height:170px;overflow: hidden;background-image:url({$vo.f_img});background-repeat: no-repeat;background-position:center center;"><!--<img src=""/>--></div>
                <div class="intro"> 
                  <h2>
                  <eq name="vo.type" value="0"><b class="xc">乡村</b><else/>
                  <b class="md">门店</b>
                  </eq>
                  {$vo.title} {$vo.u_num}{$vo.unit}</h2>
                  <h3><em>￥<b>{$vo.actual_price}</b></em><i>还差<b>{$vo.neednum}</b>份成团</i></h3>
                  <p><b><img src="{$vo.f_avatar}"/></b><i>{$vo.f_realname}</i><em>已售{$vo['actual_num']+$vo['v_num']}份</em></p>
                </div>
                </a> </li>
</volist>                
              <div class="clear"></div>
            </ul>
            <!--<div class="more">向下滑动<img src="__PUBLIC__/Wx/img/more.png"/>加载更多</div>-->
          </div>
        </gt>
            	<div class="block" style="display:none;">
                	<ul>
            <volist name="newshoparr" id="vo">
              <li> <a href="__MODULE__/Prodetail/index/id/{$vo.id}/">
                <div class="pic" style="background-size: auto 170px;height:170px;overflow: hidden;background-image:url({$vo.f_img});background-repeat: no-repeat;background-position:center center;"><!--<img src=""/>--></div>
                <div class="intro">
                  <h2>
                    <eq name="vo.type" value="0"><b class="xc">乡村</b>
                      <else/>
                      <b class="md">门店</b></eq>
                    {$vo.title} {$vo.u_num}斤</h2>
                  <h3><em>￥<b>{$vo.actual_price}</b></em>
                    <gt name="vo.neednum" value="0"><i>还差<b>{$vo.neednum}</b>份成团</i></gt>
                  </h3>
                  <p><b><img src="{$vo.f_avatar}"/></b><i>{$vo.f_realname}</i><em>已售{$vo['actual_num']+$vo['v_num']}份</em></p>
                </div>
                </a> </li>
            </volist>
                        <div class="clear"></div>
                    </ul>
                    <!--<div class="more">向下滑动<img src="__PUBLIC__/Wx/img/more.png"/>加载更多</div>-->
                </div>
            	<div class="block" style="display:none;">
                	<ul>
<volist name="willgood" id="vo">            
              <li> <a href="__MODULE__/Prodetail/index/id/{$vo.id}/">
                <div class="pic" style="background-size: auto 170px;height:170px;overflow: hidden;background-image:url({$vo.f_img});background-repeat: no-repeat;background-position:center center;"><!--<img src=""/>--></div>
                <div class="intro"> 
                  <h2>
                  <eq name="vo.type" value="0"><b class="xc">乡村</b><else/>
                  <b class="md">门店</b>
                  </eq>
                  {$vo.title} {$vo.u_num}{$vo.unit}</h2>
                  <h3><span>上架时间：<b>{$vo.starttime|date="Y-m-d",###}</b></span></h3>
                  <p><b><img src="{$vo.f_avatar}"/></b><i>{$vo.f_realname}</i><em>100人关注</em></p>
                </div>
                </a> </li>
</volist>                
                        <div class="clear"></div>
                    </ul>
                    <!--<div class="more">向下滑动<img src="__PUBLIC__/Wx/img/more.png"/>加载更多</div>-->
                </div>
            </div>
        </div>
    </div>
</div>
<script type="text/javascript" src="__PUBLIC__/Wx/js/jquery-1.9.1.js"></script>
	<script type="text/javascript">
		$('.tab span').click(function(){ 
			$(this).addClass("on").siblings().removeClass() 
			$("#tab-content >.block").hide().eq($('.tab span').index(this)).show(); 
		});
    </script>
<script type="text/javascript">
//瀑布流
var page=1;
$(function () {
	$(window).scroll(function () {
		if (($(document).height() - $(this).scrollTop() - $(this).height())<1){	
			setTimeout(function(){
				//alert("getMore");
				page++;
				getMore();
			},1000);
		}
	});
})
var show_no=0;
function getMore(){
    $.ajax({
    type : "GET",
    dataType : "json",
    url: "__MODULE__/List/index/page/"+page+"/type_id/{$_GET['type_id']}/",
    async:false,
    success: function(data){
		var html='';
		if(data.length>0){
			for(var i=0;i<data.length;i++){
				 
				html=html+"<li><a href='__MODULE__/Prodetail/index/id/"+data[i].id+"/'><div class='pic' style='background-size: auto 170px;height:170px;overflow: hidden;background-image:url("+data[i].f_img+");background-repeat: no-repeat;background-position:center center;'></div><div class='intro'><h2>";
				if(data[i].type==0){
					html=html+"<b class='xc'>乡村</b>";
				}else{
					html=html+"<b class='md'>门店</b>";
				}
				html=html+data[i].title+" "+data[i].u_num+data[i].unit+"</h2><h3><em>￥<b>"+data[i].actual_price+"</b></em>";
				if(data[i].neednum>0)html=html+"<i>还差<b>"+data[i].neednum+"</b>份成团</i>";
				html=html+"</h3><p><b><img src='"+data[i].f_avatar+"'/></b><i>"+data[i].f_realname+"</i><em>已售";
				//if(data[i].neednum>0){html=html+data[i].actual_num;}else{html=html+"0";}
						if(data[i].actual_num==null)data[i].actual_num=0;
                        html+=parseInt(data[i].actual_num)+parseInt(data[i].v_num);
				html=html+"份</em></p></div></a></li>";
				
				}//end for
			$("#list").append(html);//添加新的
			}else{
				$("#list").append("<div class='clear'></div>");
				if(show_no==0){
					$("#list").parent().append("<div class='more '>没有了</div>");
					show_no++;
				}else{}
			}
    }
	});//end ajax
}//end fun
</script>

<include file="Public/nav" />    
<script>

    $(".click span").click(function(){

        if($(this).text() ==="导航"){

            $(this).text("收起");

            $('.link02').css('display','block')

        }else{

            $(this).text("导航");

            $('.link02').css('display','none')

        }

    });

</script>

</body>
</html>